var __main = function() {
    var images = {
        ball: 'img/ball.png',
        block: 'img/block.png',
        paddle: 'img/paddle.png',
        block2: 'img/block2.png',
        block3: 'img/block3.png',
    }
    var game = GuaGame.instance(30, images, function(game) {
        var s = new SceneTitle(game)
        var e = new SceneEditor(game)
        var E = new SceneEnd(game)
        var m = new Scene(game)
        game.addScene("title", s)
        game.addScene("editor", e)
        game.addScene("end", E)
        game.addScene("main", m)
        game.runWithScene("title")

        // enableDebugMode(game, true)

        // // mouse event
        // enableDrag = false
        // var canvas = document.getElementById('id-canvas')
        // var rect = canvas.getBoundingClientRect()
        // game.canvas.addEventListener('mousedown', function(event) {
        //     var x = event.clientX - rect.left
        //     var y = event.clientY - rect.top
        //     if (pointInItem(x, y, ball)) {
        //         enableDrag = true
        //     }
        // })
        // game.canvas.addEventListener('mousemove', function(event) {
        //     var x = event.clientX - rect.left
        //     var y = event.clientY - rect.top
        //     if (enableDrag) {
        //         // log('move')
        //         ball.x = x
        //         ball.y = y
        //     }
        // })
        // game.canvas.addEventListener('mouseup', function(event) {
        //     var x = event.clientX - rect.left
        //     var y = event.clientY - rect.top
        //     enableDrag = false
        // })
        // document.querySelector('#id-ballX-speed').addEventListener('input', function(event) {
        //     var input = event.target
        //         // log('event', event.target)
        //     ball.speedX = Number(input.value)
        // })
        // document.querySelector('#id-ballY-speed').addEventListener('input', function(event) {
        //     var input = event.target
        //         // log('event', event.target)
        //     ball.speedY = Number(input.value)
        // })
    })

}